<template>
  <div class="loading-wrapper" :id="loadingId">
    <!-- <div v-if="loading" class="loading-info">loading</div> -->
    <i v-if="loading" class="el-icon-loading"></i>
    <el-divider v-else>{{ noText }}</el-divider>
  </div>
</template>

<script>
import { CommonEnum } from '@/enums'
import { ref } from 'vue'
export default {
  name: 'ShowLoading',
  props: {
    loading: {
      type: Boolean,
      default: true
    },
    noText: {
      type: String,
      default: ' 我是有底线的 '
    }
  },
  setup(props) {
    console.log(props)
    let loadingId = ref(CommonEnum.LOADING_ID)
    return { loadingId }
  }
}
</script>
<style lang="scss">
.loading-wrapper {
  padding: 0 20px;
  .el-divider__text {
    background-color: #f5f5f5;
    color: #999;
  }
}
</style>
<style scoped lang="scss">
.loading-info {
  text-align: center;
  height: 50px;
  line-height: 50px;
}
</style>